export const uploadFile = (filePath: any, formData?: any) => {
  return new Promise((resolve, reject) => {
    uni.uploadFile({
      url: process.env.VUE_APP_UPLOAD_URL,
      filePath,
      name: "file",
      header: {
        "Content-Type": "multipart/form-data",
      },
      formData,
      success: ({ data }) => {
        resolve(JSON.parse(data).data);
      },
      fail: err=>{
        reject(err)
      },
      complete: () => null,
    });
  });
};
